package net.knightwatch.kwtools.database;

import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.util.Log;

public class BooleanAnswersTable {
	private static final String TAG = "BooleanAnswersTable";
	public static final String TABLE_BOOLEAN_ANSWERS = "BooleanAnswers";
	public static final String COLUMN_ID = "_id";
	public static final String COLUMN_ANSWER_ID = "answerId";
	public static final String COLUMN_VALUE = "value";
	public static final String COLUMN_ANSWER_TEXT = "answerText";
	
	private static final String DATABASE_CREATE = "CREATE TABLE "
			+ TABLE_BOOLEAN_ANSWERS
			+ " ( "
			+ COLUMN_ID + " integer primary key autoincrement,"
			+ COLUMN_ANSWER_ID + " integer not null,"
			+ COLUMN_VALUE + " boolean not null,"
			+ COLUMN_ANSWER_TEXT + " text not null"
			+ ")";
	// On Create Method
	public static void onCreate(SQLiteDatabase database) {
		
		try {
			Log.i(TAG, DATABASE_CREATE);
			database.execSQL(DATABASE_CREATE);
		} catch (SQLException e) {
			Log.e(TAG, "Unable to create table.");
			e.printStackTrace();
		} finally {
			Log.i(TAG, "Table "+TABLE_BOOLEAN_ANSWERS+" has been created.");
		}
	}
	public static void onUpgrade(SQLiteDatabase database, int oldVersion, int newVersion){
		
	}

}
